package com.itcoon.transform.starter.handler;

import com.itcoon.transform.base.definition.InjectDefinition;
import com.itcoon.transform.starter.proxy.TransForm4jJdkProxy;

import java.util.List;

public class InterTransformHandler implements TransformHandler {
    @Override
    public boolean supports(Class<?> targetClass) {
        return targetClass.isInterface();
    }

    @Override
    public <T, R> R handle(Class<R> targetClass, T source, List<InjectDefinition.InjectInfo> injectInfos) {
        return new TransForm4jJdkProxy<>(targetClass, source, injectInfos).instance();
    }
}
